<script>
	var pnum = {$pnum};
	var goods_id = {$goods_id};
	{if condition="(!isset($search)) OR (!$search)"}
	var search = 0;
	var goUrl = "/{$Request.module}/getshops/lst/goods_id/"+goods_id+".html?page="+pnum;
	{else/}
	var search = {$search};
	var goUrl = "/{$Request.module}/getshops/search.html?page="+pnum;
	{/if}
	
</script>     

                  
                        <table id="sort" class="table table-hover table-bordered">
                            <thead>
                                <tr>
                                    <th style="width:5%"></th>
                                    <th style="width:25%">商家名称</th>
                                    <th style="width:20%">所属行业</th>
                                    <th style="width:20%">联系人</th>
                                    <th style="width:15%">手机号</th>
                                    <th style="width:15%">操作</th>
                                </tr>
                            </thead>
                            <tbody id="goods_table">
                            {if condition="$list->isEmpty() == false"}
							{foreach name="list" item="v"}
                                <tr>
                                    <td><input type="checkbox" class="text_id" name="goods_id[]" value="{$v.id}" /></td>
                                    <td>{$v.shop_name}</td>
                                    <td>{$v.industry_name}</td>
                                    <td>{$v.contacts}</td>
                                    <td>{$v.telephone}</td>
                                    <td>
                                    <button type="button" class="btn btn-danger btn-xs" onclick="$(this).parent().parent().remove();"><i class="fa fa-close"></i>&nbsp;移除</button>
                                    </td>
                                </tr>
							{/foreach}
							{else/}
							<tr><td colspan="7" style="text-align:center; font-size:14px;">没有找到相关数据</td></tr>
							{/if}				
                            </tbody>
                        </table>
                        <div class="row"><div class="pagination" style="float:right; margin-right:20px;">{$page}</div></div>
                        <div><button type="button" class="btn btn-primary" onclick="select_goods();">提交</button></div>
                        
<script>
function select_goods(){
    if($('input[class=text_id]:checked').length == 0){
        layer.msg('请选择商家', {icon: 2,time: 1000});
        return false;
    }
    //将没选中的复选框所在的  tr  remove  然后隐藏复选框
    $('input[class=text_id]:checkbox').each(function(){
    	var checked = $(this).prop('checked');
        if(!checked){
            $(this).parent().parent().remove();
        }else{
            $(this).parent().css('display','none');
            $(this).attr("checked","checked");
        }
    });
    javascript:window.parent.call_backgoods($('#goods_table').html());
}
</script>                        